# -- coding: utf-8 --
from wnboss01.action import Action
from wnboss01.tools import FileTools, Asserts


class TestCase:

    def __init__(self):
        self.testdata = FileTools.read_json('testdata.json')
        self.action = Action()

    def test_add_assets(self):

        add_assets_data = self.testdata['add_assets']
        for data in add_assets_data:
            actual = self.action.add_assets(data)
            Asserts.assert_equal(data['expect'], actual)

    def test_query_assets(self):
        query_assets_data = self.testdata['query_assets']
        for data in query_assets_data:
            actual = self.action.query_assets(data)
            Asserts.assert_equal(data['expect'], actual)

    def test_modify_assets(self):
        modify_assets_data = self.testdata['modify_assets']
        for data in modify_assets_data:
            actual = self.action.modify_assets(data)
            Asserts.assert_equal(data['expect'], actual)

if __name__ == '__main__':
    case = TestCase()
    case.test_add_assets()
    case.test_query_assets()
